﻿namespace System
{
    public struct TimeStamp
    {
        public static DateTime LocalEpoch = new DateTime(1970, 1, 1).ToLocalTime();

        private long m_ticks;

        public TimeStamp(long ticks) : this()
        {
            m_ticks = ticks;
        }

        public DateTime ToDateTime()
        {
            return LocalEpoch + new TimeSpan(m_ticks);
        }

        public override string ToString()
        {
            return string.Concat("time stamp:", m_ticks);
        }

        public static implicit operator long(TimeStamp timeStamp)
        {
            return timeStamp.m_ticks;
        }
    }
}
